<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ViewMenuTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup styleClass="view" layout="block">
                <h:panelGrid columns="2">
                    <h:outputText value="#{menuController.selected.nom}" title="#{bundle.ViewMenuTitle_nom}"
                                  style="font-size:20px;"/> <br />
                    <h:outputText value="#{bundle.ViewMenuLabel_montant}"/>
                    <h:outputText value="#{menuController.selected.montant} €" title="#{bundle.ViewMenuTitle_montant}"/>
                    <h:outputText value="#{bundle.ViewMenuLabel_dateDebut}"/>
                    <h:outputText value="#{menuController.selected.dateDebut}" title="#{bundle.ViewMenuTitle_dateDebut}">
                        <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" />
                    </h:outputText>
                    <h:outputText value="#{bundle.ViewMenuLabel_promotion}"/>
                    <h:outputText value="#{menuController.selected.promotion}" title="#{bundle.ViewMenuTitle_promotion}"/>

                    <h:outputText value="#{bundle.ViewMenuLabel_produit}"/>
                    <h:outputText value="Aucun produit associé" 
                                  rendered="#{menuController.selected.produitCollection == null or menuController.selected.produitCollection.size() == 0}"/>
                    <h:dataTable value="#{menuController.selected.produitCollection}" 
                                 rendered="#{menuController.selected.produitCollection != null and menuController.selected.produitCollection.size() > 0}"
                                 var="item" border="0" cellpadding="2" cellspacing="0" style="border:solid 1px">
                        <h:column>
                            <f:facet name="header">
                                <h:outputText value="#{bundle.ListProduitTitle}"/>
                            </f:facet>
                            <h:outputText value="#{item.nom}"/>
                        </h:column>
                    </h:dataTable>
                </h:panelGrid>


                <br />
                <h:panelGroup styleClass="boutons" layout="block">
                    <h:commandLink styleClass="supprimer" action="#{menuController.prepareList}" value="#{bundle.ViewMenuDestroyLink}"/>
                    <h:outputText value=" " />
                    <h:commandLink styleClass="modifier" action="#{menuController.prepareEditUnique}" value="#{bundle.ViewMenuEditLink}"/>
                    <br />
                    <br />
                    <h:commandLink styleClass="retour" action="#{menuController.prepareList}" value="#{bundle.ViewMenuShowAllLink}"/>
                </h:panelGroup>
            </h:panelGroup>
        </ui:define>
    </ui:composition>

</html>
